@extends('backend::layout')
@section('title',trans($page_title))
@section('content')
    <div class="row"><div class="col-sm-12">
            @if($info)
                <table class="table table-bordered info-card">
                    <tbody>
                    <tr>
                        <td class="table-active">会员信息</td>
                        <td>
                            账号:{{$info->user->user_number}}<br/>
                            姓名:{{$info->user->real_name}}<br/>
                            联系方式:{{$info->user->user_phone}}
                        </td>
                        <td class="table-active">充值信息</td>
                        <td>
                            金额:{{$info->money}}<br/>
                            账户:{{get_currency()['money2']}}<br/>
                            时间:{{$info->created_at}}
                        </td>
                    </tr>
                    <tr>
                        <td class="table-active">汇款账户</td>
                        <td>
                            <img src="{{$info->voucher}}" width="100">
                            @if($info->from_account)
                                @if(is_json($info->from_account))
                                    @foreach(json_decode($info->from_account) as $key=>$item)
                                        {{$key}}:{{$item}}<br/>
                                     @endforeach
                                @else
                                    {{$info->from_account}}
                                @endif
                            @else
                                未知
                            @endif
                        </td>
                        <td class="table-active">收款账户</td>
                        <td>
                            @if($info->to_account)
                                @if(is_json($info->to_account))
                                    @foreach(json_decode($info->to_account) as $key=>$item)
                                        {{$key}}:{{$item}}<br/>
                                    @endforeach
                                @else
                                    {{$info->from_remark}}
                                @endif
                             @else
                                未知
                             @endif
                        </td>
                    </tr>
                    <tr>
                        <td class="table-active">充值状态</td>
                        <td colspan="3">
                            @switch($info->status)
                                @case(1)
                                    充值时间:{{$info->handled_at}}<br/>
                                    备注:{{$info->to_remark ?? '无'}}
                                    @break
                                @case(-1)
                                    拒绝时间:{{$info->handled_at}}<br/>
                                    备注:{{$info->to_remark ?? '无'}}
                                    @break
                                @default
                                    @component('backend::component.form.button')
                                        @slot('title') 拒绝 @endslot
                                        @slot('class') btn-ajax @endslot
                                        @slot('color') danger @endslot
                                        @slot('params') {"prompt":{"name":"remark"},"method":"post","confirm":true,"url":"{{route('b_Recharge_rgRefuse',['id'=>$info->id])}}"} @endslot
                                        @slot('icon') hcl-circle-jian @endslot
                                    @endcomponent
                                    @component('backend::component.form.button')
                                        @slot('title') 同意 @endslot
                                        @slot('class') btn-ajax @endslot
                                        @slot('color') success @endslot
                                        @slot('params') {"confirm":true,"url":"{{route('b_Recharge_rgAgree',['id'=>$info->id])}}"} @endslot
                                        @slot('icon') hcl-bjyd @endslot
                                    @endcomponent
                            @endswitch
                        </td>
                    </tr>
                    </tbody>
                </table>
            @else
                @component('backend::public.empty_page')
                    @slot('info') 暂时没有信息 @endslot
                @endcomponent
            @endif
        </div></div>
@endsection
@push('scripts')
    <script>
        rgRefuse();
    </script>
@endpush